package com.itheima.youdianda.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.itheima.youdianda.dto.DataListDto;
import com.itheima.youdianda.dto.HotDto;
import com.itheima.youdianda.dto.NewDto;
import com.itheima.youdianda.dto.NewListDto;
import com.itheima.youdianda.entity.YddArticle;
import com.itheima.youdianda.util.MyPages;

import java.util.Map;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author author
 * @since 2022-05-24
 */
public interface YddArticleService extends IService<YddArticle> {
    HotDto getHot();

    MyPages<YddArticle> getMyArticleByPage(String page, String limit);


    Map<String, Object> show(String id);

    /**
     * 对文章进行 点赞/取消点赞和收藏/取消收藏
     *
     * @param type       1->收藏, 2->点赞
     * @param action     del: 取消收藏/点赞, add: 收藏/点赞
     * @param article_id 操作的文章id
     */
    void userDataHandle(String type, String action, String article_id);

    NewListDto getNewList(String page, String limit);

    DataListDto getDataList(String page, String limit, String cateid);

}
